fn main() {
    let prefix = "xdelta3";
    for file in std::fs::read_dir("./src").unwrap() {
        let file_name = file.unwrap().file_name().into_string().unwrap();
        if file_name.len() > prefix.len() && &file_name[0..prefix.len()] == prefix { 
            println!("cargo:rerun-if-changed=src/{}", file_name);
        }
    }
    
    cc::Build::new()
        .file("./src/xdelta3.c")
        // .flag("-Wunused-value")
        // .flag("-Wimplicit-fallthrough=1")
        .warnings(false)
        .opt_level(3)
        .include("./src")
        .define("SIZEOF_SIZE_T", format!("{}",std::mem::size_of::<libc::size_t>()).as_str())
        .define("SIZEOF_UNSIGNED_LONG_LONG", format!("{}",std::mem::size_of::<libc::c_ulonglong>()).as_str())
        .compile("xdelta3");
}